package com.xgy.ordering.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Controller
public class WebController {

    private static final Logger logger = LoggerFactory.getLogger(WebController.class);

    @GetMapping("/")
    public String index() {
        logger.info("访问首页，重定向到index.html");
        // 直接返回静态页面，不需要Model参数
        return "redirect:/index.html";
    }

    @GetMapping("/dashboard")
    public String dashboard(Model model) {
        logger.info("访问性能监控仪表板页面");
        model.addAttribute("pageTitle", "性能监控仪表板");
        logger.debug("仪表板页面属性设置完成");
        return "dashboard";
    }
}